/*
 * All rights Reserved, Designed By baowei
 *
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 */
package com.xyy.scaffoldservice.impl;

import com.xyy.scaffolddao.dataobject.UserDO;
import com.xyy.scaffolddao.mapper.UserMapper;
import com.xyy.scaffoldservice.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author : jiazhuang
 * @since : 2023/6/7, Wed
 **/
@Service
public class UserServiceImpl implements UserService {
    @Resource
    UserMapper userMapper;

    /**
     * 根据姓名查找
     */
   public UserDO findUserByName(String name) {
        return userMapper.findUserByName(name);
    }

    /**
     * 根据id查找
     */
    public UserDO findUserById(@Param("id") Long id) {
        return userMapper.findUserById(id);
    }

    /**
     * 插入用户
     */
    public void insertUser(@Param("name") String name) {
        userMapper.insertUser(name);
    }
}
